package interview.huawei.tjt.training.huaweijishitiku;

import java.util.Scanner;

// 字符串最后一个单词的长度的求解；反过来打印
public class StringLength1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        int count = 0;
        for (int i = str.length() - 1; i >= 0; i--) {
            if (str.charAt(i) == ' ') {
                break;
            }
            count ++;
        }
        System.out.println(count);
    }
}
